/**
 * AlertDefinitionServiceImpl.java
 * Created at 2017-4-25
 * Created by shihui
 * Copyright (C) 2016 BROADTEXT SOFTWARE, All rights reserved.
 */
package com.broadtext.rms.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.broadtext.common.exp.DaoException;
import com.broadtext.common.exp.ServiceException;
import com.broadtext.common.repository.EntityDao;
import com.broadtext.common.service.impl.EntityServiceImpl;
import com.broadtext.rms.system.model.TtAlertDefinition;
import com.broadtext.rms.system.service.IAlertDefinitionService;

/**
 * <p>ClassName: AlertDefinitionServiceImpl</p>
 * <p>Description: 告警定义服务层</p>
 * <p>Author: shihui</p>
 * <p>Date: 2017-4-25</p>
 */
@Service("alertDefinitionService")
public class AlertDefinitionServiceImpl extends EntityServiceImpl<TtAlertDefinition> implements IAlertDefinitionService {
    @Autowired
    @Qualifier("alertDefinitionDao")
    public void setEntityDao(EntityDao<TtAlertDefinition> entityDao) {
        super.entityDao = entityDao;
    }

    @SuppressWarnings("unchecked")
    @Override
    public List<Object> getAlertLevelOpt() throws ServiceException {
        try {
            return this.entityDao.findByQuery(
                "com.broadtext.rms.system.model.TtAlertDefinition.getAlertLevelOpt", null);
        } catch (DaoException e) {
            throw new ServiceException(e);
        }
    }
}
